<template>
  <div class="admin-container">
    <!-- <div class="container-1200"> -->
      <div class="title mg-B20">项目详情表</div>
      <div style="border: solid 1px black">
        <el-row>
          <el-col :span="4">项目名称</el-col>
          <el-col :span="4">项目类别</el-col>
          <el-col :span="4">启动时间</el-col>
          <el-col :span="4">建设内容及目标</el-col>
          <el-col :span="8">三年计划:投资、预计收益、创就业岗位数</el-col>
        </el-row>
        <el-row>
          <el-col :span="4">{{ projectInfo.projectName }}</el-col>
          <el-col :span="4">{{ projectInfo.projectCategoryId }}</el-col>
          <el-col :span="4">{{ projectInfo.startDate }}</el-col>
          <el-col :span="4">{{ projectInfo.jsmb }}</el-col>
          <el-col :span="8">{{ projectInfo.syjh }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="24">企业基本情况（一）</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">企业名称</el-col>
          <el-col :span="12" class="leftAlign-pd30">{{
            projectInfo.compnayName
          }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">企业负责人</el-col>
          <el-col :span="12" class="leftAlign-pd30">{{
            projectInfo.linkman
          }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30"
            >企业负责人联系人电话</el-col
          >
          <el-col :span="12" class="leftAlign-pd30">{{
            projectInfo.phone
          }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">企业等级注册类型</el-col>
          <el-col :span="12" class="leftAlign-pd30">{{
            registrationFormate(projectInfo.registration)
          }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">行业类型</el-col>
          <el-col :span="12" class="leftAlign-pd30">{{
            projectInfo.industry
          }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">企业纳税人类型</el-col>
          <el-col :span="12" class="leftAlign-pd30">{{
            taxTypeFormate(projectInfo.taxType)
          }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">是否高新科技企业</el-col>
          <el-col :span="12" class="leftAlign-pd30">{{
            projectInfo.isHighSalary == true ? "是" : "不是"
          }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">是否科技型中小企业</el-col>
          <el-col :span="12" class="leftAlign-pd30">{{
            projectInfo.isKjxzxqy == true ? "是" : "不是"
          }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30"
            >是否有IPO、新三板、并购退出</el-col
          >
          <el-col :span="12" class="leftAlign-pd30">{{
            projectInfo.isIpo == true ? "是" : "不是"
          }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30"
            >融资轮次（种子、天使、A、B、C）</el-col
          >
          <el-col :span="12" class="leftAlign-pd30">{{
            lzjdFormate(projectInfo.lzjd)
          }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">企业资产估值</el-col>
          <el-col :span="4">万元</el-col>
          <el-col :span="8">{{ projectInfo.zcgz }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">指标</el-col>
          <el-col :span="4">计量单位</el-col>
          <el-col :span="8">数量</el-col>
        </el-row>
        <el-row>
          <el-col :span="24">一、企业基本情况</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30"
            >获得天使或风险投资额</el-col
          >
          <el-col :span="4">千元</el-col>
          <el-col :span="8">{{ projectInfo.lzjr }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">企业成立时注册资本</el-col>
          <el-col :span="4">千元</el-col>
          <el-col :span="8">{{ projectInfo.zczb }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="24">二、企业经济情况</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30"
            >企业2020至今的投资额</el-col
          >
          <el-col :span="4">千元</el-col>
          <el-col :span="8">{{ projectInfo.bytz }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">企业上年总收入</el-col>
          <el-col :span="4">千元</el-col>
          <el-col :span="8">{{ projectInfo.sbysl }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">当年获得政府资金</el-col>
          <el-col :span="4">千元</el-col>
          <el-col :span="8">{{ projectInfo.dyzfzj }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">企业净利润</el-col>
          <el-col :span="4">千元</el-col>
          <el-col :span="8">{{ projectInfo.qyjll }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">企业出口总额</el-col>
          <el-col :span="4">千元</el-col>
          <el-col :span="8">{{ projectInfo.qyzck }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30"
            >企业研究与试验发展（R&D）经费支出</el-col
          >
          <el-col :span="4">千元</el-col>
          <el-col :span="8">{{ projectInfo.rdjfzc }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">企业实际上缴税费</el-col>
          <el-col :span="4">千元</el-col>
          <el-col :span="8">{{ projectInfo.qysjsjsf }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="24">三、企业从业人员情况</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">企业从业人员</el-col>
          <el-col :span="4">人</el-col>
          <el-col :span="8">{{ projectInfo.employeeNum }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd40">其中：博士</el-col>
          <el-col :span="4">人</el-col>
          <el-col :span="8">{{ projectInfo.bsyg }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">硕士</el-col>
          <el-col :span="4">人</el-col>
          <el-col :span="8">{{ projectInfo.ssyg }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">本科</el-col>
          <el-col :span="4">人</el-col>
          <el-col :span="8">{{ projectInfo.bkyg }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">大专</el-col>
          <el-col :span="4">人</el-col>
          <el-col :span="8">{{ projectInfo.dzyg }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">留学人员</el-col>
          <el-col :span="4">人</el-col>
          <el-col :span="8">{{ projectInfo.lxry }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">千人计划人数</el-col>
          <el-col :span="4">人</el-col>
          <el-col :span="8">{{ projectInfo.zrjlrs }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">百人计划人数</el-col>
          <el-col :span="4">人</el-col>
          <el-col :span="8">{{ projectInfo.sbrcrs }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">吸纳应届大学毕业生</el-col>
          <el-col :span="4">人</el-col>
          <el-col :span="8">{{ projectInfo.yjbys }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="24">四、企业知识产权情况</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">当年知识产权申请数</el-col>
          <el-col :span="4">件</el-col>
          <el-col :span="8">{{ projectInfo.zscqsq }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">当年只是产权授权数</el-col>
          <el-col :span="4">件</el-col>
          <el-col :span="8">{{ projectInfo.zscqsqs }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd40">其中：发明专利</el-col>
          <el-col :span="4">件</el-col>
          <el-col :span="8">{{ projectInfo.zscqfmzl }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">拥有有效知识产权数</el-col>
          <el-col :span="4">件</el-col>
          <el-col :span="8">{{ projectInfo.yyzscqs }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd40">其中：发明专利</el-col>
          <el-col :span="4">件</el-col>
          <el-col :span="8">{{ projectInfo.yxzscqs }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">软件著作权</el-col>
          <el-col :span="4">件</el-col>
          <el-col :span="8">{{ projectInfo.rjzzq }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">植物新品种</el-col>
          <el-col :span="4">个</el-col>
          <el-col :span="8">{{ projectInfo.zwxpz }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">集成电路布图</el-col>
          <el-col :span="4">个</el-col>
          <el-col :span="8">{{ projectInfo.jcdlbt }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">PCT专利</el-col>
          <el-col :span="4">个</el-col>
          <el-col :span="8">{{ projectInfo.pct }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">购买国外专利</el-col>
          <el-col :span="4">件</el-col>
          <el-col :span="8">{{ projectInfo.gmgwzl }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">技术合同交易数量</el-col>
          <el-col :span="4">项</el-col>
          <el-col :span="8">{{ projectInfo.jshtjys }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">技术合同交易额</el-col>
          <el-col :span="4">千元</el-col>
          <el-col :span="8">{{ projectInfo.jshtjyr }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30"
            >当年承担国家级科技计划项目数</el-col
          >
          <el-col :span="4">项</el-col>
          <el-col :span="8">{{ projectInfo.gjkjxms }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30"
            >当年获得市级以上奖励</el-col
          >
          <el-col :span="4">项</el-col>
          <el-col :span="8">{{ projectInfo.cjysjl }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="24">五、产学研合作情况</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">产学研合作项目数</el-col>
          <el-col :span="4">个</el-col>
          <el-col :span="8">{{ projectInfo.cxyhzxm }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30"
            >产学研合作项目总金额</el-col
          >
          <el-col :span="4">千元</el-col>
          <el-col :span="8">{{ projectInfo.cxyhzjr }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="24">六、双创载体建设情况</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd30">建设双创载体的数量</el-col>
          <el-col :span="4">个</el-col>
          <el-col :span="8">{{ projectInfo.jssczts }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd40">其中：孵化器</el-col>
          <el-col :span="4">个</el-col>
          <el-col :span="8">{{ projectInfo.fhq }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">众创空间</el-col>
          <el-col :span="4">个</el-col>
          <el-col :span="8">{{ projectInfo.zckj }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">台青创基地</el-col>
          <el-col :span="4">个</el-col>
          <el-col :span="8">{{ projectInfo.dqjd }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">技术创新中心</el-col>
          <el-col :span="4">个</el-col>
          <el-col :span="8">{{ projectInfo.jscxzx }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">工程研究中心</el-col>
          <el-col :span="4">个</el-col>
          <el-col :span="8">{{ projectInfo.gcyjzx }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">产业创新中心</el-col>
          <el-col :span="4">个</el-col>
          <el-col :span="8">{{ projectInfo.cycxzx }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="leftAlign-pd80">新兴研发机构</el-col>
          <el-col :span="4">个</el-col>
          <el-col :span="8">{{ projectInfo.xxyfjg }}</el-col>
        </el-row>
      </div>
    <!-- </div> -->
  </div>
</template>

<script>
import LangSelect from "@/components/LangSelect";
import { validUsername } from "@/utils/validate";
import utils from "@/utils/utils.js";
import { list as dictList } from "@/api/dict";
import { find as projectFind } from "@/api/project";

export default {
  components: {},
  name: "company",
  data() {
    const validatePassword = (rule, value, callback) => {
      if (value.length < 6) {
        callback(new Error("密码不能少于6位"));
      } else {
        callback();
      }
    };
    return {
      projectId: "",
      projectInfo: {},

      //获取字典的promise
      taxTypeDictPromise: "",
      registrationDictPromise: "",
      lzjdDictPromise: "",
    };
  },
  watch: {
    $route: {
      handler: function (route) {},
      immediate: true,
    },
  },

  created() {
    this.taxTypeDictPromise = this.getDictList("tax_type", (res) => {
      this.taxTypeDict = res.data;
    });
    this.registrationDictPromise = this.getDictList("registration", (res) => {
      this.registrationDict = res.data;
    });
    this.lzjdDictPromise = this.getDictList("lzjd", (res) => {
      this.lzjdDict = res.data;
    });
    
  },

  mounted() {
    console.log('this.taxTypeDictPromise--',this.taxTypeDictPromise);
    Promise.all([
      this.taxTypeDictPromise,
      this.registrationDictPromise,
      this.lzjdDictPromise,
    ]).then((res) => {
      console.log('res--',res);
      if (this.$route.query) {
        this.projectId = this.$route.query.projectId;
        this.getProjectInfo(this.projectId);
      }
    });
  },

  destroyed() {},

  methods: {
    //获取项目信息
    getProjectInfo(projectId) {
      projectFind(projectId)
        .then((res) => {
          console.log("projectFind成功获取数据--", res);
          if (res.type == "success") {
            this.projectInfo = res.data.project;
          }
        })
        .catch((err) => {
          this.$message.error(err.msg);
        });
    },

    //字典信息获取
    getDictList(type, callback, errCallback) {
      let params = new URLSearchParams();
      params.append("dictType", type);
      return dictList(params)
        .then((res) => {
          console.log(type + "字典--", res);
          if (res.type == "success") {
            if (callback) {
              callback(res.data);
            }
          }
        })
        .catch((err) => {
          if (errCallback) {
            errCallback();
          }
        });
    },

    //字典数据格式化
    taxTypeFormate(data) {
      return utils.selectDictLabel(this.taxTypeDict, data);
    },

    registrationFormate(data) {
      return utils.selectDictLabel(this.registrationDict, data);
    },

    lzjdFormate(data) {
      return utils.selectDictLabel(this.lzjdDict, data);
    },
  },
};
</script>

<style lang="scss" scoped>
.el-col {
  border: solid 1px black;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 30px;
  border-collapse: collapse !important;
}

.leftAlign-pd30 {
  justify-content: left;
  padding-left: 30px;
}
.leftAlign-pd40 {
  justify-content: left;
  padding-left: 40px;
}
.leftAlign-pd80 {
  justify-content: left;
  padding-left: 80px;
}
</style>
